GetChnnelsInfo

Function

This API is used by the hot standby management device to obtain channel information from the working device.

Request Message

Parameter Description

Table 1

ParameterRangeTypeDescription
channels"All"
"CH1"…"CHx"
"IP_CH1"…"IP_CHx"
"WIFI_CH1"…"WIFI_CHx"
string array
base_x_publicobjectFor detailed information, please refer to Table 2.

Table 2

ParameterRangeTypeDescription
keystring
seqint

Sample:

POST /API/RecordPatch/GetChannelsInfo HTTP/1.1
{
    "data": {
        "channels": [
            "CH1"
        ],
        "base_x_public": {
            "key": "0HPdedLykSzlof0GUwmVGFkkbyvSYGz4aQxGgn5nVnEw=",
            "seq": 0
        }
    }
}

Response Message

Parameter Description

Table 3

ParameterRangeTypeDescription
channels"All"
"CH1"…"CHx"
"IP_CH1"…"IP_CHx"
"WIFI_CH1"…"WIFI_CHx"
objectFor detailed information, please refer to Table 4.
worker_macxx-xx-xx-xx-xx-xxstringThe MAC address of the working device.

Table 4

ParameterRangeTypeDescription
enableboolWhether to enable the channel.
channel_indexintChannel number of the frontend device.
protocolstring
connect_method"General", "Security"string"General": Prefer HTTP
"Security": Prefer HTTPS
camera_mode"Auto", "Normal"stringCamera mode.
main_urlstringThe url of the main stream when connecting using rtsp.
sub_urlstringThe url of the substream when connecting using rtsp.
ipstring
usernamestring
peer_keystring
cipherstringEncrypted password.
seqint
portint

Sample:

HTTP/1.1 200 OK
Content-Type: application/json
{
    "result": "success",
    "data": {
        "channels": {
            "CH1": {
                "enable": true,
                "channel_index": 0,
                "protocol": "Private",
                "connect_method": "General",
                "camera_mode": "Auto",
                "main_url": "",
                "sub_url": "",
                "ip": "172.16.11.50",
                "username": "admin",
                "peer_key": "07uKqG8PGyqWLbqt7vN18Rqg4p17+UfRmcZAZQ0NKDAc=",
                "cipher": "0XfBrLSeFZiEFjNl0tiMauJ/aWDkuTvDXHextl1fZrgppV4KEUw==",
                "seq": 0,
                "port": 80
            }
        },
        "worker_mac": "xx-xx-xx-xx-xx-xx"
    }
}